package miiteen.sys.task;

import miiteen.sys.cache.LoginInfoCache;
import org.apache.commons.lang.time.DateFormatUtils;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.text.DateFormat;
import java.util.Date;

@Component
public class LoginInfoCacheTask {

    @Scheduled(cron = "0 0 2 * * ?")
    public void clear() {
        System.out.println("【" + DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss") + "】 清除失效缓存 ");
        LoginInfoCache.clear();
    }
}
